package com.isoftstone.merchant.service.bind.impl;

import com.isoftstone.common.Page;
import com.isoftstone.merchant.dao.bind.MBindMapper;
import com.isoftstone.merchant.entity.bind.MBind;
import com.isoftstone.merchant.service.bind.BindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: zhaojg
 * @Description
 * @Date: Created in 22:06 2017/12/14
 * @Modified by:
 */
@Service
public class BindServiceImpl implements BindService {

    @Autowired
    MBindMapper mBindMapper;
    /**
     * 增加
      @param bind
     * @return
     * @throws Exception
     */
    @Override
    public int addBind(MBind bind) throws Exception {
        return mBindMapper.addBind(bind);
    }
    @Override
    public void saveBind(MBind mBind) throws Exception {
        mBindMapper.insertSelective(mBind);
    }

    @Override
    public MBind queryBindByThreeParam(String feeUserId,String corpId,String openAccount) throws Exception {
        return mBindMapper.queryBindByThreeParam(feeUserId,corpId,openAccount);
    }

    @Override
    public void updateBindByFeeUserId(MBind bind) throws Exception {
        mBindMapper.updateBindByFeeUserId(bind);
    }

    @Override
    public MBind getBindUserNumber(Page page) throws Exception {
        return mBindMapper.getBindUserNumber(page);
    }

    @Override
    public Integer getUserNumber(Page page) throws Exception {
        return mBindMapper.getUserNumber(page);
    }

    @Override
    public Integer getTodayUserNumber(Page page) throws Exception {
        return mBindMapper.getTodayUserNumber(page);
    }

    @Override
    public void cancelContract(String feeUserId,String corpId,String openAccount) throws Exception {
        mBindMapper.cancelContract(feeUserId,corpId,openAccount);
    }

    @Override
    public void extentContract(String feeUserId,String corpId,String openAccount) throws Exception {
        mBindMapper.extentContract(feeUserId,corpId,openAccount);
    }

    @Override
    public MBind queryMbindByThreeParam(String feeUserId, String openAccount, String corpId) throws Exception {
        return mBindMapper.queryMbindByThreeParam(feeUserId,openAccount,corpId);
    }

}
